import Vue from 'vue'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
// import '@/assets/css/asciinema-player.css';
// import '@/assets/js/app-5d2ed0622958ce48f556f852b8e9bd1a.js';
// import '@/assets/js/asciinema-player-e90dd959bf7df7e1608c08ac419fca67.js';
// import { Tree } from 'element-ui'
// import VueRouter from 'vue-router';
import App from './App.vue';
// import './plugins/element.js';
// import  routes  from './router'
import router from './router'

import ViewUI from 'view-design';
import VueQuillEditor from 'vue-quill-editor'

import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
import 'view-design/dist/styles/iview.css';
// import { directive } from 'vue/types/umd';

// import 'xterm/css/xterm.css'

{/* <link rel="stylesheet" href="node_modules/xterm/css/xterm.css" />
<script src="node_modules/xterm/lib/xterm.js"></script> */}


Vue.config.productionTip = false
Vue.use(ElementUI);
// Vue.use(Tree)
Vue.use(ViewUI);
Vue.use(VueQuillEditor)


// const router = new VueRouter({
//   routes,
//   // mode: 'history'
// })


Vue.directive('has', {
  inserted: function(el, binding) {
    if (!Vue.prototype.$_has(binding.value)) {
      el.parentNode.removeChild(el);
    }
  }
});


Vue.prototype.$_has = function(value){
  // console.log(value)
  // return false
  let isExists = false;
  let op_str = sessionStorage.getItem('operation_list')
  if (op_str == undefined || op_str == null){
    return false
  }
  let op_list = JSON.parse(op_str)
  if(op_list.indexOf(value) != -1){
    isExists = true
  }
  return isExists
}

Vue.prototype.$bus = new Vue({
  // beforeCreate: function () {
  //   console.log(this.$bus)
  // },
  router,
  render: h => h(App),
}).$mount('#app')



